import { __DEV__ } from '@hs-admin/utils'
import { create } from 'zustand'

type State = {
  tabKey: string
  data_item_id: string | null
  status: string
}

type Actions = {
  setTabKey: (qty: string) => void
  setDataItemId: (qty: string | null) => void
  setStatus: (qty: string) => void
}

export const useTypeStore = create<State & Actions>((set) => ({
  tabKey: __DEV__ ? '2' : '1',
  data_item_id: null,
  status: 'draft',
  setTabKey: (value: string) => set(() => ({ tabKey: value })),
  setDataItemId: (value: string | null) => set(() => ({ data_item_id: value })),
  setStatus: (value: string) => set(() => ({ status: value }))
}))
